#!/bin/sh
#
# This is the configuration script for regression testing
#

. ${1}/config


if [ -d build-webui ] ; then
  echo  build-webui exist...
else
   mkdir build-webui
fi
cd build-webui

if [ -f CMakeCache.txt  ] ; then
  echo  "CMakeCache.txt exist, not calling cmake"
else
   cmake  ../../webui \
      -DCMAKE_VERBOSE_MAKEFILE=ON \
      -DCMAKE_INSTALL_PREFIX:PATH=${1}/usr \
      -DCMAKE_INSTALL_LIBDIR:PATH=${1}/usr/lib \
      -DSHARE_INSTALL_PREFIX:PATH=${1}/usr/share \
    -Dsysconfdir=${1}/bin \
    -Dconfdir=${1}/bin \
    -Dwebuiconfdir=${1}/bin \
    ${PASSWD} \
    -Dbaseport=${BASEPORT}\
    ${COVERAGE} \
    ${TRAYMON}\
    ${VERSION_STRING} \
    -Dbindir=${1}/bin \
    -Dsbindir=${1}/bin \
    -Dlibdir=${1}/bin \
    -Dmandir=${1}/bin \
    -Ddocdir=${1}/bin/html \
    -Dhtmldir=${1}/bin/html \

fi

LD_LIBRARY_PATH=${1}/bin:${LD_LIBRARY_PATH}
export LD_LIBRARY_PATH

cd ..

exit 0
